This repository was archived by the owner on Sep 28, 2022. It is now read-only.
Add document:mCreate#64
Merged
Merged
Conversation
scottinet
suggested changes
Feb 25, 2020
| | Arguments | Type | Description | | ||
| | ------------------ | -------------------------------------------- | --------------------------------- | | ||
| | `_id` | <pre>String</pre> (optional) | Optional document ID. Will be auto-generated if not defined. | | ||
| | `body` | <pre>Boolean</pre> (optional) | Document body | |
| | `index` | <pre>String</pre> | Index | | ||
| | `collection` | <pre>String</pre> | Collection | | ||
| | `documents` | <pre>ArrayList<ConcurrentHashMap<String, Object>></pre> | ArrayList containing the documents to create | | ||
| | `waitForRefresh` | <pre>Boolean</pre> | Optional parameters | |
Contributor
There was a problem hiding this comment.
Wrong parameter description
|
|
||
| ## Return | ||
|
|
||
| A `ConcurrentHashMap` which has a `successes` and `errors` array: |
Contributor
There was a problem hiding this comment.
You must provide the exact type for the successes and errors values, otherwise they aren't usable
Aschen
suggested changes
Feb 27, 2020
| ConcurrentHashMap<String, ArrayList<Object>> response = kuzzle.getDocumentController().mCreate("nyc-open-data", "yellow-taxi", documents) | ||
| .get(); | ||
|
|
||
| System.out.println("Successfully created " + response.get("successes").size() + " documents"); |
Contributor
There was a problem hiding this comment.
Can you do the snippet test on something from the result as well as for the other methods?
Also can you add the result of the println in comment?
It helps developer to better apprehend the structure of the response object they have. We try to do this for every method (Look the Javascript SDK and Doc)
jenow
approved these changes
Mar 2, 2020
Aschen
approved these changes
Mar 2, 2020
d37a222 to
49a0997
Compare
Makes it easier to read in documentation pages
scottinet
approved these changes
Mar 6, 2020
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do ?
This PR implements the
mCreatemethod with its unit tests.How should this be manually tested?
Clone this branch and run unit tests
./gradlew testWhen it succeed, compile it
./gradlew jarInitiate another java project by adding the compiled SDK as a dependency.
Then, run Kuzzle, create an index
nyc-open-dataand ayellow-taxicollection in the admin console.Finally, run this code
You should see the documents in your collection.